
#include "about.h"

	// constant strings that will appear in the text boxes
static const char authorstr[] =  
	"Author : Mochan Shrestha";

static const char email[] =
	"mailto:shresthm@csis.gvsu.edu";

static const char homepage[] = 
	"http://www.csis.gvsu.edu/~shresthm/screensavers/sierpinski.htm";

	// callback function to the about dialog box
BOOL APIENTRY AboutConfigureDialog (HWND hDlg, 
	 UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message)
	{
	case WM_NOTIFY:
		switch (( (NMHDR*)lParam ) -> code)
		{
		case PSN_SETACTIVE:
				// When the dialog is active set the strings into the
				// text boxes
			SetDlgItemText (hDlg, IDC_ABOUTAPPAUTHOR, authorstr);
			SetDlgItemText (hDlg, IDC_ABOUTAPPEMAIL, email);
			SetDlgItemText (hDlg, IDC_ABOUTAPPHOMEPAGE, homepage);
			break;
		}
		return TRUE;
		break;
	case WM_COMMAND:
		switch (LOWORD(wParam))
		{
		case IDB_WRITE:
			ShellExecute(NULL, NULL, email, NULL, NULL, SW_SHOW);
			break;
		case IDB_VISIT:
			ShellExecute(NULL, NULL, homepage, NULL,NULL, SW_SHOW);
			break;
		}
		break;
		return TRUE;
	}

	return FALSE;
}